<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('登记管理列表')" />
    <style>
        .xiaoma button{
            display: none;
        }
        .xiaoma td{
            text-align: center;
        }
        .xiaoma th{
            text-align: center;
        }
    </style>
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>访客标识：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>登记时间：</label>
                                <input type="text" name=""/>
                            </li>
                            <li>
                                <label>来访小区：</label>
                                <select id="districtId" class="form-control" name="districtId"  data-none-selected-text="请选择小区" th:with="MetaList=${@common.districtList()}">
                                    <option value="">所有</option>
                                    <option th:each="Meta : ${MetaList}" th:text="${Meta.name}"
                                            th:value="${Meta.id}"></option>
                                </select>
                            </li>
                            <li>
                                <label>来访类型：</label>
                                <input type="text" name="type"/>
                            </li>
                            <li>
                                <label>来访事由：</label>
                                <input type="text" name="reason"/>
                            </li>
                            <li>
                                <label>创建人：</label>
                                <input type="text" name="createName"/>
                            </li>
                            <li>
                                <label>放行人：</label>
                                <input type="text" name="releaseName"/>
                            </li>
                            <li style="margin-left: 200px">
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="djb:registry:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="djb:registry:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="djb:registry:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="djb:registry:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
<!--            </div>-->
            <div class="col-sm-12 select-table table-striped xiaoma" style="">
                <table id="bootstrap-table" style="border: 2px solid #a94442"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('djb:registry:edit')}]];
        var removeFlag = [[${@permission.hasPermi('djb:registry:remove')}]];
        var prefix = ctx + "djb/registry";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                sortName: "createTime",
                sortOrder: "desc",
                modalName: "登记管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'name',
                    title: '访客标识'
                },
                {
                    field: 'createTime',
                    title: '登记时间'
                },
                {
                    field: 'districtName',
                    title: '来访小区'
                },
                {
                    field: 'status',
                    title: '创建状态',
                    formatter: function(value, row, index) {
                        if(value===10){
                            return "已过期"
                        }else if(value===1){
                            return "已放行"
                        }else if(value===5){
                            return "已驳回"
                        }else if(value===0){
                            return "待进场"
                        }else if(value===2){
                            return "待审核"
                        }else if(value===11){
                            return "已作废"
                        }else if(value===20){
                            return "已出场"
                        }else if(value===21){
                            return "已纠错"
                        }else{
                            return "其他"
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'0' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>